package com.sto.stoapp.entity;

import java.text.SimpleDateFormat;

import android.annotation.SuppressLint;
import com.sto.stoapp.http.BaseMessage;
import com.sto.stoapp.util.UnifiedStaticType;

/**
 * 到包预报消息实体类
 * @author mgf
 *
 */
@SuppressLint("SimpleDateFormat")
public class DownCastEntity extends BaseEntity {

    private String barCode; // 单号/包号
    private String scanDate; // 扫描日期
    private String scanTime; // 扫描时间
    private String incTime; // 增量时间
    private String fileName; // 文件名
    private String remark; // 备注
    private String siteName; // 网点名称
    private String salesName; // 员工名
    private String routeCode; // 路由号
    private String flight; // 航班

    public DownCastEntity() {

    }

    public DownCastEntity(String responseDetail, String incTime) {
        this.incTime = incTime;
        String[] data = responseDetail.split(BaseMessage.COMMA);
        if (data.length > 0) {
            barCode = data[0].trim();
        }
        if (data.length > 1) {
            SimpleDateFormat sDateFormat = new SimpleDateFormat(
                    UnifiedStaticType.DATE_TIME_FORMAT);
            String date = sDateFormat.format(new java.util.Date());
            String arrays[] = date.split(" ");
            scanDate = arrays[1];
            scanTime = arrays[0];
        }
        if (data.length > 2) {
            siteName = data[2].trim();
        }
        if (data.length > 3) {
            routeCode = data[3].trim();
        }
        if (data.length > 4) {
            remark = data[4];
        }
        if (data.length > 5) {
            salesName = data[5].trim();
        }
        if (data.length > 6) {
            flight = data[6].trim();
            fileName = siteName + BaseMessage.DASH + incTime + BaseMessage.DASH
                    + flight + ".txt";
        }

    }

    public String getBarCode() {
        return barCode;
    }

    public void setBarCode(String barCode) {
        this.barCode = barCode;
    }

    public String getSiteName() {
        return siteName;
    }

    public void setSiteName(String siteName) {
        this.siteName = siteName;
    }

    public String getSalesName() {
        return salesName;
    }

    public void setSalesName(String salesName) {
        this.salesName = salesName;
    }

    public String getRouteCode() {
        return routeCode;
    }

    public void setRouteCode(String routeCode) {
        this.routeCode = routeCode;
    }

    public String getFlight() {
        return flight;
    }

    public void setFlight(String flight) {
        this.flight = flight;
    }

    public String getScanDate() {
        return scanDate;
    }

    public void setScanDate(String scanDate) {
        this.scanDate = scanDate;
    }

    public String getScanTime() {
        return scanTime;
    }

    public void setScanTime(String scanTime) {
        this.scanTime = scanTime;
    }

    public String getIncTime() {
        return incTime;
    }

    public void setIncTime(String incTime) {
        this.incTime = incTime;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public String toString() {
        return "DownCastEntity [barCode=" + barCode + ", incTime=" + incTime
                + ", fileName=" + fileName + ", remark=" + remark
                + ", routeCode=" + routeCode + ", flight=" + flight + "]";
    }
  
    
}
